import request from '@/utils/request'

export function login(data) {
    return request({
        url: '/sys/login',
        method: 'post',
        data
    })
}

export function getUserInfo(data) {
    return request({
        url: '/sys/profile',
        method: "post",
        data
     })
}

export function getUserDetailById (id) {
    return request({
        url: `/sys/user/${id}`,
     })
}

export function logout() {
    
}
// 保存员工的密码
export function saveUserDetailById(data) {
    return request({
      url: `/sys/user/${data.id}`,
      data,
      method: 'put'
    })
  }
  // 分配角色
export function assignRole (data) {
    return request({
        url: `/sys/user/assignRoles`,
        method: "put",
        data
    })
}
